package astarDemo;

import astar.AStar;
import astar.AStarConstants;
import astar.Area;
import astar.Path;


public class Main {
	
	public static void main(String[] args) {
		Area area = new Area(100, 100);
		for(int y=1; y<100; y++) {
			area.edit(11,y, AStarConstants.TERRAIN_IMPASSABLE);
		}
		
		AStar aStar = new AStar();
		long start = System.currentTimeMillis();
		Path path = aStar.getPath(0, 0, 99, 99, area, 4);
		float time = System.currentTimeMillis() - start;
		System.out.println("Explored "+aStar.exploredNodes.size()+" nodes\n");
		System.out.println("Path has "+path.nodes.length+" nodes\n");
		System.out.println("Took "+(time/1000f)+" sec");
		System.out.println("\n\n\n");
		System.out.println(area.toString(path));
		System.out.println("End");
	}

}
